<template>
    <CostForm :conditionForm="conditionForm" :addition-rules="rules" form-name="add" @change-props="changeProps">
        <template v-slot:addtionItem>
            <el-form-item label="整车编码" prop="bomId">
                <el-input v-model="conditionForm.bomId"></el-input>
            </el-form-item>
        </template>
    </CostForm>
</template>
<script lang="ts" setup>
import CostForm from '@/components/material-cost/CostForm.vue'
import { ref } from 'vue';

const conditionForm = ref({
    organizationCode: "",
    costTypeId: "",
    bomId: "",
    bomVOS: [
        // {
        //     "isLeaf": 0,
        //     "level": 0,
        //     "parentMaterialId": 0,
        //     "parentMaterialCode": "",
        //     "parentMaterialName": "",
        //     "materialId": 0,
        //     "materialCode": "",
        //     "materialName": "",
        //     "amount": 0,
        //     "effectivityDate": "",
        //     "disableDate": ""
        // }
    ]
})
const rules = ref({
    bomId: [
        { required: false, message: '请输入整车编码', trigger: 'blur' },
    ]
})
const changeProps = (data: any) => {
    conditionForm.value.costTypeId = data.costTypeId.split(',')[0];
}
</script>
<style lang="scss" scoped></style>
